package base.day17.api;

public class TestApi1 {
    public static void main(String[] args) {
        //Math类
        //.abs,返回参数的绝对值
        int abs= Math.abs(-10);
        System.out.println(abs);
        //.ceil 向上取整
        double ceil= Math.ceil(4.33);
        System.out.println(ceil);
        //.floor 向下取整
        double floor= Math.floor(4.33);
        System.out.println(floor);
        //.round 四舍五入
        float round=Math.round(4.33);
        System.out.println(round);
        //.max 返回两个int类型中最大值
        int max= Math.max(10,20);
        System.out.println(max);
        //.min 返回两个int类型中最小的值
        int min= Math.min(10,20);
        System.out.println(min);
        //..pow 返回a的b次幂的值
        double pow= Math.pow(2,4);
        System.out.println(pow);
        //.random 返回double的正值
        double random= Math.random();
        System.out.println(random);
    }
}
